<template>
    <div>
        <el-dialog
            title=""
            :visible.sync="showPreview">
            <img :src="url" class="preview">
        </el-dialog>
    </div>
</template>

<script>
export default {
    props: ["ifShow","url"],
    data() {
      return {
          showPreview:false,
      };
    },
    watch: {
        //每次弹窗都要加载数据
        ifShow(val){
            this.showPreview = true;
        },
    },
    methods: {

    },
};
</script>

<style lang="scss" scoped>
/deep/ .el-dialog__headerbtn{
    display: none;
}
/deep/ .el-dialog__body{
    padding: 0;
}
/deep/ .el-dialog__header{
    padding: 0;
}
/deep/ .el-dialog{
    max-width: 90%;
}
//图片预览
.preview{
  display: block;
    width: 100%;
    //max-height: calc(100vh - 250px);
}
</style>
